package com.own.business.wallet.business.entity;

import com.own.business.wallet.entity.map.WalletHistoryMapVo;
import com.own.business.wallet.entity.po.WalletHistory;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;

/**
 * PayResultEntity
 * <p>
 * 支付结果处理对象
 *
 * @author chenxueli
 * @date 2023-07-28 08:42:00
 */
@Getter
@Setter
@NoArgsConstructor
public class PayResultEntity implements Serializable {

    @Schema(title = "商户订单号")
    private String outTradeNo;

    @Schema(title = "支付状态 2=支付成功 3=支付失败 4=主动关闭取消 5=超时取消")
    private Integer status;

    @Schema(title = "支付订单信息")
    private WalletHistoryMapVo order;

    public PayResultEntity(WalletHistory order) {
        this.order = new WalletHistoryMapVo(order);
        this.outTradeNo = order.getOutTradeNo();
        this.status = order.getStatus();
    }

}
